using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace Bosphorus.Integration.Jira.Thor.Dal.Helper
{
    public class ParameteredQueryModel: QueryModel
    {
        private ParameterdDelegate delegation;
        private object[] parameters;
        public delegate object ParameterdDelegate(params object[] parameters);

        private ParameteredQueryModel(string queryName)
            : base(queryName)
        {
        }

        public ParameteredQueryModel(string queryName, ParameterdDelegate delegation, object[] parameters)
            : this(queryName)
        {
            this.delegation = delegation;
            this.parameters = parameters;
        }

        public override IList GetData()
        {
            return (IList)delegation(parameters);
        }
    }
}